package com.gee.spring.cloud.feign.flow.execute;

import com.gee.spring.cloud.feign.flow.work.impl.EndWork;
import com.gee.spring.cloud.feign.flow.work.impl.InitWork;

/**
 * desc:
 *
 * @author gee wrote on  2021-01-16 20:08:56
 */
public class WorkExecuteDesigner {

    private InitWork initWork;

    private EndWork endWork;

    private WorkExecuteDesigner(InitWork initWork, EndWork endWork) {
        this.initWork = initWork;
        this.endWork = endWork;
    }

    public EndWork getEndWork() {
        return endWork;
    }

    public InitWork getInitWork(){
        return initWork;
    }

    public static WorkExecutorDesignerBuilder builder(){
        return new WorkExecutorDesignerBuilder();
    }

    public static class WorkExecutorDesignerBuilder {

        private InitWork initWork;

        private EndWork endWork;

        public WorkExecutorDesignerBuilder initWork(InitWork initWork){
            this.initWork = initWork;
            return this;
        }

        public WorkExecutorDesignerBuilder endWork(EndWork endWork){
            this.endWork = endWork;
            return this;
        }
        public WorkExecuteDesigner build(){
            return new WorkExecuteDesigner(initWork, endWork);
        }

    }
}
